package com.own.business.login.core.config;

import com.own.business.login.core.service.AfterDetailUserInfoService;
import com.own.business.login.core.service.LoginService;
import com.own.business.login.core.service.RegisterService;
import com.own.business.login.core.service.UserInfoService;
import com.own.business.login.core.service.impl.LoginServiceImpl;
import com.own.business.login.core.service.impl.RegisterServiceImpl;
import com.own.business.login.core.service.impl.UserInfoServiceImpl;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.context.annotation.Bean;
import org.springframework.stereotype.Component;

/**
 * AutoConfig
 *
 * @author chenxueli
 * @date 2023-06-25 17:01:00
 */
@Component
public class AutoConfig {

    @Bean
    @ConditionalOnMissingBean(LoginService.class)
    public LoginService loginService() {
        return new LoginServiceImpl();
    }

    @Bean
    @ConditionalOnMissingBean(AfterDetailUserInfoService.class)
    public AfterDetailUserInfoService afterDetailUserInfoService() {
        return new AfterDetailUserInfoService() {
        };
    }

    @Bean
    @ConditionalOnMissingBean(RegisterService.class)
    public RegisterService registerService() {
        return new RegisterServiceImpl();
    }

    @Bean
    @ConditionalOnMissingBean(UserInfoService.class)
    public UserInfoService userInfoService() {
        return new UserInfoServiceImpl();
    }

}
